FAQ汇萃 >> Oracle 专栏 >> 查看数据库各类型空间使用情况 [查看别人的评论]

由 macro 发布于: 2001-03-03 09:28


set pagesize 50000
set line 80

col "Total Used Meg" format 999,999,990
col "Data part" format 999,999,990
col "Index part" format 999,999,990
col "LOB part" format 999,999,990
col "RBS part" format 999,999,990

tti 'Used space in Meg by segment type'

select sum(bytes)/1024/1024 "Total Used",
sum( decode( substr(segment_type,1,5), 'TABLE', bytes/1024/1024, 0))
"Data part",
sum( decode( substr(segment_type,1,5), 'INDEX', bytes/1024/1024, 0))
"Index part",
sum( decode( substr(segment_type,1,3), 'LOB', bytes/1024/1024, 0))
"LOB part",
sum( decode(segment_type, 'ROLLBACK', bytes/1024/1024, 0))
"RBS part",
sum( decode(segment_type, 'TEMPORARY', bytes/1024/1024, 0))
"TEMP part"
from sys.dba_segments
/
tti off

tti "Total database size"

select sum(bytes)/1024/1024 "Total DB size in Meg"
from sys.v_$datafile
/
tti off


result screen:


Used space in Meg by segment type

Total Used Data part Index part LOB part RBS part TEMP part
---------- ------------ ------------ ------------ ------------ ----------
102.304688 57 26 1 15 .2734375


Total database size

Total DB size in Meg
--------------------
409.382813

点这里对该文章发表评论

该文章总得分是 0 分,你认为它对你有帮助吗? [非常多](0) [有一些](0) [无帮助](0) [是灌水](0)

Copyright © 2001 - 2009 JSP001.com . All Rights Reserved